package com.icesoft.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.icesoft.framework.core.annotation.Entity;
import com.icesoft.framework.core.data.access.DataAccessCheckpoint;
import com.icesoft.framework.core.entity.BaseEntity;
import com.icesoft.system.annotation.AssociationCount;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 组织机构
 *
 * @author ${author}
 * @date 230326
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_org")
@Entity(module = "system", describe = "组织机构")
@AssociationCount("组织机构")
public class Org extends BaseEntity {

	@TableField
	@Column(value = "name", comment = "名称", length = 255, type = MySqlTypeConstant.VARCHAR)
	private String name;

	@TableField
	@Column(value = "pid", comment = "父id", length = 40, type = MySqlTypeConstant.BIGINT)
	private Long pid;

	@DataAccessCheckpoint()
	@TableField(fill = FieldFill.INSERT)
	@Column(value = "company_id", comment = "公司", length = 40, type = MySqlTypeConstant.BIGINT)
	private Long companyId;

	@TableField
	@Column(value = "sort", comment = "排序", length = 40, type = MySqlTypeConstant.BIGINT)
	private int sort;

	@TableField
	@Column(value = "status", comment = "状态", length = 1, type = MySqlTypeConstant.BIT)
	private Boolean status;

	@TableField
	@Column(value = "is_leaf", comment = "叶子节点", length = 1, type = MySqlTypeConstant.BIT)
	private Boolean isLeaf = true;

}
